package com.hugoo.rpt.busz;

import com.hugoo.core.ConfigurationError;
import com.hugoo.rpt.ParamError;
import javax.servlet.http.HttpServletRequest;

/**
 *
 * @author Lovelock.Chan
 */
public class HLinkHtmlGenAction extends HtmlGenAction {

    private String _para_in_, _spxs_;

    public HLinkHtmlGenAction(String sid, HttpServletRequest request) throws ParamError, ConfigurationError {
        super(sid, request);
        _para_in_ = request.getParameter("_para_in_");
        _spxs_ = request.getParameter("_spxs_");
    }

    @Override
    public String getTextInfo() {
        StringBuilder sb = new StringBuilder();
        if (_spxs_ != null) {
            return super.getTextInfo();
        }
        sb.append("<html><head><script src='tpl/js/jquery.min.js'></script>"
                + "<link href='tpl/css/defaultTheme.css' rel='stylesheet'/>"
                + "<link href='tpl/css/xTheme.css' rel='stylesheet' />"
                + "<script src='tpl/js/jquery.fixedheadertable.min.js'></script>"
                + "<script src='tpl/js/jquery.blockui.js'></script>"
                + "<script src='tpl/js/hlink.rpt.js'></script>"
                + "</head><body><div id='qdiv' _sid_='").append(_sid).append("' sfrm='").
                append(_para_in_).append("'>").append(super.getTextInfo()).append("</div></body></html>");
        return sb.toString();
    }
}
